# _*_ coding:utf-8 _*_
import pygame
from pygame.locals import *
import sys

soundstr = '../sound/Minecraft-Levelup.wav'
warningstr = '../sound/Warning Forever.ogg'
# pygame.mixer.pre_init()来进行最先的声音系统初始化工作.在pygame.init中初始化所有的东西
# pygame.mixer.pre_init(22050, 16, 2, 4096)
pygame.init()
screen=pygame.display.set_mode((700,600),0,32)
print(pygame.mixer.get_num_channels())
bgsound = pygame.mixer.Sound(soundstr)
# mixer.Sound用来播放较短的音频文件，只支持ogg，wav格式
warningsound = pygame.mixer.Sound(warningstr)
bgsound.set_volume(0.2)
bgsound.play(-1, 10000)
warningsound.set_volume(0.3)
warningsound.play(3, 10000)
while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            sys.exit()

    screen.fill(pygame.color.Color("gray"))
    pygame.display.update()




pygame.quit()